<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社交论坛列表 - 筛选查询</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <style>
        :root {
            --primary: #4F46E5;
            --primary-light: #818CF8;
            --primary-dark: #3730A3;
            --secondary: #10B981;
            --light-bg: #F8FAFC;
            --card-bg: #FFFFFF;
            --text-primary: #1E293B;
            --text-secondary: #64748B;
            --border-light: #E2E8F0;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --radius: 8px;
            --transition: all 0.3s ease;
        }
        
        body {
            font-family: 'Inter', system-ui, sans-serif;
            background-color: var(--light-bg);
            color: var(--text-primary);
            line-height: 1.6;
        }
        
        .container {
            max-width: 1400px;
        }
        
        .section-header {
            margin-bottom: 2rem;
        }
        
        .section-title {
            font-size: 1.8rem;
            font-weight: 700;
            position: relative;
            padding-bottom: 0.75rem;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: 0;
            width: 50px;
            height: 3px;
            background-color: var(--primary);
            border-radius: 3px;
        }
        
        .section-description {
            color: var(--text-secondary);
            max-width: 800px;
        }
        
        /* 筛选区域样式 */
        .filters-container {
            background-color: var(--card-bg);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .filter-section {
            margin-bottom: 1.5rem;
        }
        
        .filter-section:last-child {
            margin-bottom: 0;
        }
        
        .filter-title {
            font-weight: 600;
            margin-bottom: 0.75rem;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .search-bar {
            position: relative;
        }
        
        .search-bar input {
            width: 100%;
            padding: 0.75rem 1rem 0.75rem 2.5rem;
            border: 1px solid var(--border-light);
            border-radius: var(--radius);
            font-size: 0.95rem;
            transition: var(--transition);
        }
        
        .search-bar input:focus {
            outline: none;
            border-color: var(--primary-light);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        .search-bar i {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
        }
        
        .filter-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
        }
        
        .filter-tag {
            padding: 0.35rem 1rem;
            border-radius: 20px;
            background-color: var(--light-bg);
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            font-size: 0.9rem;
            cursor: pointer;
            transition: var(--transition);
        }
        
        .filter-tag:hover {
            background-color: rgba(79, 70, 229, 0.05);
            border-color: var(--primary-light);
            color: var(--primary);
        }
        
        .filter-tag.active {
            background-color: rgba(79, 70, 229, 0.1);
            border-color: var(--primary-light);
            color: var(--primary);
            font-weight: 500;
        }
        
        .filter-select {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid var(--border-light);
            border-radius: var(--radius);
            background-color: var(--light-bg);
            color: var(--text-primary);
            font-size: 0.95rem;
            transition: var(--transition);
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 0.75rem center;
        }
        
        .filter-select:focus {
            outline: none;
            border-color: var(--primary-light);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        .filter-actions {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
            margin-top: 1rem;
        }
        
        .btn-reset {
            background-color: var(--light-bg);
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
            padding: 0.5rem 1.25rem;
            border-radius: var(--radius);
            font-weight: 500;
            transition: var(--transition);
        }
        
        .btn-reset:hover {
            background-color: #F1F5F9;
            color: var(--text-primary);
        }
        
        .btn-apply {
            background-color: var(--primary);
            color: white;
            border: none;
            padding: 0.5rem 1.25rem;
            border-radius: var(--radius);
            font-weight: 500;
            transition: var(--transition);
        }
        
        .btn-apply:hover {
            background-color: var(--primary-dark);
        }
        
        /* 结果统计和视图切换 */
        .results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .results-count {
            color: var(--text-secondary);
            font-size: 0.95rem;
        }
        
        .view-options {
            display: flex;
            gap: 0.5rem;
        }
        
        .view-btn {
            background-color: var(--light-bg);
            border: 1px solid var(--border-light);
            width: 36px;
            height: 36px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
        }
        
        .view-btn:hover {
            background-color: rgba(79, 70, 229, 0.05);
            color: var(--primary);
        }
        
        .view-btn.active {
            background-color: var(--primary);
            border-color: var(--primary);
            color: white;
        }
        
        /* 论坛卡片基础样式 */
        .forum-card {
            background-color: var(--card-bg);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden;
            transition: var(--transition);
            margin-bottom: 1.5rem;
            border: none;
        }
        
        .forum-card:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-hover);
        }
        
        .forum-header {
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .forum-title {
            font-size: 1.25rem;
            font-weight: 600;
            margin: 0;
            transition: var(--transition);
        }
        
        .forum-title a {
            color: var(--text-primary);
            text-decoration: none;
        }
        
        .forum-title a:hover {
            color: var(--primary);
        }
        
        .forum-meta {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        
        .meta-item {
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }
        
        .forum-content {
            padding: 1.25rem;
        }
        
        .forum-desc {
            color: var(--text-secondary);
            margin-bottom: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .forum-media {
            margin-bottom: 1rem;
            border-radius: var(--radius);
            overflow: hidden;
        }
        
        .media-single {
            width: 100%;
            height: 200px;
            object-fit: cover;
        }
        
        .media-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
        }
        
        .media-grid img {
            width: 100%;
            height: 100px;
            object-fit: cover;
        }
        
        .media-grid img:first-child {
            grid-column: span 2;
            grid-row: span 2;
            height: 204px;
        }
        
        .forum-footer {
            padding: 0.75rem 1.25rem;
            border-top: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .forum-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        
        .forum-tag {
            font-size: 0.8rem;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            background-color: rgba(79, 70, 229, 0.1);
            color: var(--primary);
            text-decoration: none;
            transition: var(--transition);
        }
        
        .forum-tag:hover {
            background-color: rgba(79, 70, 229, 0.2);
            color: var(--primary-dark);
        }
        
        .forum-actions {
            display: flex;
            gap: 1rem;
        }
        
        .action-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.9rem;
            cursor: pointer;
            transition: var(--transition);
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
        }
        
        .action-btn:hover {
            color: var(--primary);
            background-color: rgba(79, 70, 229, 0.05);
        }
        
        .action-btn.saved {
            color: var(--primary);
        }
        
        /* 布局变体 */
        .list-view .forum-card {
            display: flex;
            height: 220px;
        }
        
        .list-view .forum-media {
            width: 30%;
            margin: 0;
            border-radius: var(--radius) 0 0 var(--radius);
        }
        
        .list-view .media-single {
            height: 100%;
            border-radius: var(--radius) 0 0 var(--radius);
        }
        
        .list-view .media-grid {
            height: 100%;
        }
        
        .list-view .media-grid img {
            height: 100%;
        }
        
        .list-view .media-grid img:first-child {
            height: 100%;
        }
        
        .list-view .forum-body {
            width: 70%;
            display: flex;
            flex-direction: column;
        }
        
        .grid-view {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }
        
        .compact-view .forum-card {
            padding: 1rem;
        }
        
        .compact-view .forum-header {
            padding: 0 0 0.5rem 0;
            border: none;
        }
        
        .compact-view .forum-content {
            padding: 0.5rem 0;
        }
        
        .compact-view .forum-title {
            font-size: 1.1rem;
            margin-bottom: 0.25rem;
        }
        
        .compact-view .forum-desc {
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }
        
        .compact-view .forum-footer {
            padding: 0.5rem 0 0 0;
            border: none;
        }
        
        /* 分页样式 */
        .pagination-container {
            margin-top: 2rem;
            display: flex;
            justify-content: center;
        }
        
        .pagination {
            display: flex;
            gap: 0.5rem;
        }
        
        .page-btn {
            width: 36px;
            height: 36px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: var(--card-bg);
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
        }
        
        .page-btn:hover {
            border-color: var(--primary-light);
            color: var(--primary);
        }
        
        .page-btn.active {
            background-color: var(--primary);
            border-color: var(--primary);
            color: white;
        }
        
        .page-btn.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        /* 响应式调整 */
        @media (max-width: 992px) {
            .list-view .forum-card {
                flex-direction: column;
                height: auto;
            }
            
            .list-view .forum-media,
            .list-view .forum-body {
                width: 100%;
            }
            
            .list-view .media-single {
                border-radius: var(--radius) var(--radius) 0 0;
            }
            
            .filter-row {
                flex-direction: column;
                gap: 1rem;
            }
            
            .filter-col {
                width: 100% !important;
            }
        }
        
        @media (max-width: 768px) {
            .section-title {
                font-size: 1.5rem;
            }
            
            .media-grid img {
                height: 80px;
            }
            
            .media-grid img:first-child {
                height: 164px;
            }
            
            .forum-meta {
                gap: 1rem;
            }
            
            .results-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
            }
        }
        
        @media (max-width: 576px) {
            .forum-footer {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
            }
            
            .forum-actions {
                width: 100%;
                justify-content: space-between;
            }
            
            .media-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .media-grid img:first-child {
                grid-column: span 1;
                grid-row: span 1;
                height: 80px;
            }
            
            .filter-actions {
                flex-direction: column;
            }
            
            .btn-reset, .btn-apply {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <div class="container py-5 px-4">
        <div class="section-header">
            <h2 class="section-title">论坛列表</h2>
            <p class="section-description">探索各种兴趣社区，加入讨论，分享你的想法和经验。使用下方筛选器找到你感兴趣的论坛。</p>
        </div>
        
        <!-- 筛选区域 -->
        <div class="filters-container">
            <div class="row filter-row gap-3">
                <!-- 搜索框 -->
                <div class="col-lg-4 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-search"></i> 搜索
                        </h3>
                        <div class="search-bar">
                            <i class="fas fa-search"></i>
                            <input type="text" placeholder="搜索论坛名称或描述...">
                        </div>
                    </div>
                </div>
                
                <!-- 分类筛选 -->
                <div class="col-lg-4 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-th-large"></i> 分类
                        </h3>
                        <div class="filter-tags">
                            <div class="filter-tag active">全部</div>
                            <div class="filter-tag">科技</div>
                            <div class="filter-tag">生活</div>
                            <div class="filter-tag">娱乐</div>
                            <div class="filter-tag">教育</div>
                            <div class="filter-tag">职场</div>
                            <div class="filter-tag">健康</div>
                            <div class="filter-tag">艺术</div>
                            <div class="filter-tag">其他</div>
                        </div>
                    </div>
                </div>
                
                <!-- 活跃度筛选 -->
                <div class="col-lg-4 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-bolt"></i> 活跃度
                        </h3>
                        <div class="filter-tags">
                            <div class="filter-tag active">全部</div>
                            <div class="filter-tag">非常活跃</div>
                            <div class="filter-tag">较活跃</div>
                            <div class="filter-tag">一般</div>
                            <div class="filter-tag">较少</div>
                        </div>
                    </div>
                </div>
                
                <!-- 排序方式 -->
                <div class="col-lg-4 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-sort"></i> 排序方式
                        </h3>
                        <select class="filter-select">
                            <option value="recommended">推荐排序</option>
                            <option value="popular">按热度排序</option>
                            <option value="recent">最新创建</option>
                            <option value="posts">帖子数量</option>
                            <option value="views">浏览量</option>
                        </select>
                    </div>
                </div>
                
                <!-- 成员数量 -->
                <div class="col-lg-4 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-users"></i> 成员数量
                        </h3>
                        <select class="filter-select">
                            <option value="all">全部规模</option>
                            <option value="large">1000人以上</option>
                            <option value="medium">100-1000人</option>
                            <option value="small">100人以下</option>
                        </select>
                    </div>
                </div>
                
                <!-- 创建时间 -->
                <div class="col-lg-4 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-calendar"></i> 创建时间
                        </h3>
                        <select class="filter-select">
                            <option value="any">不限时间</option>
                            <option value="week">最近一周</option>
                            <option value="month">最近一月</option>
                            <option value="quarter">最近三月</option>
                            <option value="year">最近一年</option>
                        </select>
                    </div>
                </div>
            </div>
            
            <div class="filter-actions">
                <button class="btn-reset">重置筛选</button>
                <button class="btn-apply">应用筛选</button>
            </div>
        </div>
        
        <!-- 结果头部 -->
        <div class="results-header">
            <div class="results-count">找到 <strong>248</strong> 个论坛，显示 1-12 个</div>
            <div class="view-options">
                <div class="view-btn active" data-view="list-view" title="列表视图">
                    <i class="fas fa-list"></i>
                </div>
                <div class="view-btn" data-view="grid-view" title="网格视图">
                    <i class="fas fa-th"></i>
                </div>
                <div class="view-btn" data-view="compact-view" title="紧凑视图">
                    <i class="fas fa-compress"></i>
                </div>
            </div>
        </div>
        
        <!-- 论坛列表 - 默认列表视图 -->
        <div class="forums-container list-view">
            <!-- 论坛1 - 单图 -->
            <div class="forum-card">
                <div class="forum-media">
                    <img src="https://picsum.photos/id/1040/400/300" alt="科技前沿论坛封面" class="media-single">
                </div>
                <div class="forum-body">
                    <div class="forum-header">
                        <h3 class="forum-title">
                            <a href="#">科技前沿论坛</a>
                        </h3>
                        <div class="forum-meta">
                            <div class="meta-item">
                                <i class="fas fa-eye"></i>
                                <span>12.8k 浏览</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>3.2k 帖子</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>5.7k 成员</span>
                            </div>
                        </div>
                    </div>
                    <div class="forum-content">
                        <p class="forum-desc">
                            讨论最新科技趋势、人工智能发展、区块链应用、元宇宙概念以及各类数码产品评测。这里汇聚了众多科技爱好者和行业专家，分享前沿资讯和独到见解。
                        </p>
                    </div>
                    <div class="forum-footer">
                        <div class="forum-tags">
                            <a href="#" class="forum-tag">科技</a>
                            <a href="#" class="forum-tag">人工智能</a>
                            <a href="#" class="forum-tag">数码产品</a>
                        </div>
                        <div class="forum-actions">
                            <button class="action-btn saved">
                                <i class="fas fa-bookmark"></i>
                                <span>已收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 论坛2 - 无图 -->
            <div class="forum-card">
                <div class="forum-body" style="width: 100%;">
                    <div class="forum-header">
                        <h3 class="forum-title">
                            <a href="#">财经投资论坛</a>
                        </h3>
                        <div class="forum-meta">
                            <div class="meta-item">
                                <i class="fas fa-eye"></i>
                                <span>15.2k 浏览</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>4.8k 帖子</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>8.3k 成员</span>
                            </div>
                        </div>
                    </div>
                    <div class="forum-content">
                        <p class="forum-desc">
                            讨论股票、基金、加密货币等投资产品，分享市场分析和投资策略。论坛有专业的金融分析师定期发布研究报告，帮助普通投资者了解市场动态，做出明智的投资决策。
                        </p>
                    </div>
                    <div class="forum-footer">
                        <div class="forum-tags">
                            <a href="#" class="forum-tag">财经</a>
                            <a href="#" class="forum-tag">投资</a>
                            <a href="#" class="forum-tag">理财</a>
                        </div>
                        <div class="forum-actions">
                            <button class="action-btn saved">
                                <i class="fas fa-bookmark"></i>
                                <span>已收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 论坛3 - 多图 -->
            <div class="forum-card">
                <div class="forum-media">
                    <div class="media-grid">
                        <img src="https://picsum.photos/id/431/400/400" alt="美食制作展示">
                        <img src="https://picsum.photos/id/292/200/200" alt="餐厅推荐">
                        <img src="https://picsum.photos/id/488/200/200" alt="烘焙作品">
                        <img src="https://picsum.photos/id/312/200/200" alt="美食摄影">
                    </div>
                </div>
                <div class="forum-body">
                    <div class="forum-header">
                        <h3 class="forum-title">
                            <a href="#">美食爱好者论坛</a>
                        </h3>
                        <div class="forum-meta">
                            <div class="meta-item">
                                <i class="fas fa-eye"></i>
                                <span>18.7k 浏览</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>5.3k 帖子</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>12.5k 成员</span>
                            </div>
                        </div>
                    </div>
                    <div class="forum-content">
                        <p class="forum-desc">
                            分享食谱、烹饪技巧、餐厅推荐和美食摄影。从家常菜到米其林料理，从甜点到主菜，这里有各种美食相关的内容。会员们经常组织线下美食聚会，一起探索城市中的隐藏美食。
                        </p>
                    </div>
                    <div class="forum-footer">
                        <div class="forum-tags">
                            <a href="#" class="forum-tag">生活</a>
                            <a href="#" class="forum-tag">美食</a>
                            <a href="#" class="forum-tag">烹饪</a>
                        </div>
                        <div class="forum-actions">
                            <button class="action-btn">
                                <i class="far fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 论坛4 - 单图 -->
            <div class="forum-card">
                <div class="forum-media">
                    <img src="https://picsum.photos/id/292/400/300" alt="旅行摄影论坛封面" class="media-single">
                </div>
                <div class="forum-body">
                    <div class="forum-header">
                        <h3 class="forum-title">
                            <a href="#">旅行摄影论坛</a>
                        </h3>
                        <div class="forum-meta">
                            <div class="meta-item">
                                <i class="fas fa-eye"></i>
                                <span>9.5k 浏览</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>2.1k 帖子</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>4.2k 成员</span>
                            </div>
                        </div>
                    </div>
                    <div class="forum-content">
                        <p class="forum-desc">
                            分享旅行见闻、摄影技巧和绝美风景照片。无论你是专业摄影师还是业余爱好者，都能在这里找到灵感和实用建议。论坛定期举办摄影比赛和线上分享会，帮助成员提升技能。
                        </p>
                    </div>
                    <div class="forum-footer">
                        <div class="forum-tags">
                            <a href="#" class="forum-tag">生活</a>
                            <a href="#" class="forum-tag">旅行</a>
                            <a href="#" class="forum-tag">摄影</a>
                        </div>
                        <div class="forum-actions">
                            <button class="action-btn">
                                <i class="far fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 分页 -->
        <div class="pagination-container">
            <div class="pagination">
                <div class="page-btn disabled">
                    <i class="fas fa-chevron-left"></i>
                </div>
                <div class="page-btn active">1</div>
                <div class="page-btn">2</div>
                <div class="page-btn">3</div>
                <div class="page-btn">4</div>
                <div class="page-btn">5</div>
                <div class="page-btn">
                    <i class="fas fa-chevron-right"></i>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Bootstrap 5 JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 筛选标签切换
            const filterTags = document.querySelectorAll('.filter-tag');
            filterTags.forEach(tag => {
                tag.addEventListener('click', function() {
                    // 如果是"全部"标签，取消同组其他标签的选中状态
                    if (this.textContent === '全部') {
                        const siblings = this.parentElement.querySelectorAll('.filter-tag');
                        siblings.forEach(sib => sib.classList.remove('active'));
                        this.classList.add('active');
                    } else {
                        // 取消同组"全部"标签的选中状态
                        const allTag = this.parentElement.querySelector('.filter-tag:first-child');
                        if (allTag.textContent === '全部') {
                            allTag.classList.remove('active');
                        }
                        
                        // 切换当前标签状态
                        this.classList.toggle('active');
                        
                        // 如果同组没有选中的标签，选中"全部"
                        const activeTags = this.parentElement.querySelectorAll('.filter-tag.active');
                        if (activeTags.length === 0 && allTag) {
                            allTag.classList.add('active');
                        }
                    }
                });
            });
            
            // 视图切换
            const viewBtns = document.querySelectorAll('.view-btn');
            const forumsContainer = document.querySelector('.forums-container');
            
            viewBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    // 移除所有按钮的活跃状态
                    viewBtns.forEach(b => b.classList.remove('active'));
                    
                    // 添加当前按钮的活跃状态
                    this.classList.add('active');
                    
                    // 移除容器的所有视图类
                    forumsContainer.classList.remove('list-view', 'grid-view', 'compact-view');
                    
                    // 添加当前视图类
                    forumsContainer.classList.add(this.dataset.view);
                });
            });
            
            // 收藏功能
            const saveButtons = document.querySelectorAll('.action-btn').forEach(button => {
                const icon = button.querySelector('.fa-bookmark');
                const text = button.querySelector('span');
                
                button.addEventListener('click', function() {
                    if (this.classList.contains('saved')) {
                        // 取消收藏
                        this.classList.remove('saved');
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        if (text) text.textContent = '收藏';
                    } else {
                        // 收藏
                        this.classList.add('saved');
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        if (text) text.textContent = '已收藏';
                    }
                });
            });
            
            // 分页功能
            const pageBtns = document.querySelectorAll('.page-btn:not(.disabled)');
            pageBtns.forEach(btn => {
                if (!btn.querySelector('i')) { // 不是箭头按钮
                    btn.addEventListener('click', function() {
                        pageBtns.forEach(b => b.classList.remove('active'));
                        this.classList.add('active');
                        // 在实际应用中，这里会加载对应页的内容
                        console.log(`切换到第 ${this.textContent} 页`);
                    });
                }
            });
            
            // 重置筛选按钮
            const resetBtn = document.querySelector('.btn-reset');
            resetBtn.addEventListener('click', function() {
                // 重置所有筛选标签
                document.querySelectorAll('.filter-tag').forEach(tag => {
                    tag.classList.remove('active');
                    if (tag.textContent === '全部') {
                        tag.classList.add('active');
                    }
                });
                
                // 重置下拉选择框
                document.querySelectorAll('.filter-select').forEach(select => {
                    select.selectedIndex = 0;
                });
                
                // 重置搜索框
                document.querySelector('.search-bar input').value = '';
            });
            
            // 应用筛选按钮
            const applyBtn = document.querySelector('.btn-apply');
            applyBtn.addEventListener('click', function() {
                // 收集所有筛选条件
                const searchTerm = document.querySelector('.search-bar input').value;
                const categories = Array.from(document.querySelectorAll('.filter-tags:nth-of-type(2) .filter-tag.active'))
                    .map(tag => tag.textContent);
                const activity = Array.from(document.querySelectorAll('.filter-tags:nth-of-type(3) .filter-tag.active'))
                    .map(tag => tag.textContent);
                const sortBy = document.querySelector('.filter-select').value;
                const memberCount = document.querySelector('.filter-select:nth-of-type(2)').value;
                const createTime = document.querySelector('.filter-select:nth-of-type(3)').value;
                
                // 在实际应用中，这里会根据筛选条件请求数据
                console.log('应用筛选条件:', {
                    searchTerm,
                    categories,
                    activity,
                    sortBy,
                    memberCount,
                    createTime
                });
                
                // 显示筛选反馈
                alert('筛选条件已应用！在实际应用中，这里会显示符合条件的论坛列表。');
            });
        });
    </script>
</body>
</html>
    
